﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Reflection;

using VirtualDrum.lib.db;

namespace VirtualDrum.lib
{
	class DBFactory
	{
		private static readonly string dbType = ConfigurationSettings.AppSettings["Database"];
		private static IFactory objIFactory = null;
		private string _className;
		private static readonly string AssembyName = "VirtualDrum";
		public DBFactory(){
			this._className = DBFactory.AssembyName + ".lib.db." + ConfigurationSettings.AppSettings["Database"] + "Factory";
		}
		public ControlDatabase createDBServer(){
			objIFactory = (IFactory)Assembly.Load(DBFactory.AssembyName).CreateInstance(this._className);
			return objIFactory.createInstance();
		}
	}
}
